package com.apes.autoparts.product.model;


import com.apes.framework.jpa.BaseModel;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.framework.util.ApesConst;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * 类描述：轮胎标准商品
 *
 * @ClassName TyreProduct
 * @Description 描述
 * @Author lilong
 * @Date 2022/10/25 16:34
 * @Version 1.0
 */

@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = TyreProduct.CONST_TABLE_NAME)
public class TyreProduct extends BaseModel {
    public static final String CONST_TABLE_NAME = "auto_tyre_product";
    @Id
    @Column(name = "id", length = 8)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "轮胎标准商品")
    @Comment("编码")
    private String id;

    @Column(name = "brand", length = 100)
    @Comment("品牌")
    private String brand;

    @Column(name = "pn", length = 100)
    @Comment("零件名称")
    private String pn;

    @Column(name = "specification", nullable = false, length = 100)
    @Comment("规格")
    private String specification;

    @Column(name = "figure", nullable = false, length = 100)
    @Comment("花纹")
    private  String figure;

    @Column(name = "load_index", nullable = false)
    @Comment("载重指数")
    private String loadIndex;

    @Column(name = "speed_class", nullable = false, length = 100)
    @Comment("速度等级")
    private String speedClass;

    @Column(name = "anti_explosion", nullable = false, columnDefinition = "number(1,0) default 0")
    @Comment("是否防爆")
    private boolean antiExplosion;

    @Column(name = "describe", length = 100)
    @Comment("产品描述")
    private String describe;

    @Column(name = "unit", length = 100)
    @Comment("单位")
    private String unit;

    @Column(name = "bar_code", length = 100)
    @Comment("条形码")
    private String barCode;

    @Column(name = "ERP_product_id", length = 100)
    @Comment("ERP商品编码")
    private String ERPProductId;
}
